/** 公共函数 */
export default {
  // 加载js
  loadJS: function (options) {
    if (typeof options === 'string') {
      options = {
        path: options
      }
    }
    options = options || {}
    let path = options.path
    let callback = options.callback || function () {
    }
    if (!path) {
      return
    }
    var script = document.createElement('script')
    script.type = 'text/javascript'
    script.src = path
    document.getElementsByTagName('head')[0].appendChild(script)
    script.onload = callback // js加载完成执行方法
  }
}
